package com.tul.exercise.base.thread.base;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 *单线程的线程池
 */
public class SingleThreadPool {
    public static void main(String[] args) {
        ExecutorService service = Executors.newSingleThreadExecutor();
        for (int i = 0; i < 5; i++) {
            service.execute(new LightOff());
        }

        service.shutdown();
    }
}
